package com.feng.zhihao.apigeteway.gateway.bean.impl.PARAMS_POSITION.RES;

import java.io.IOException;

import org.springframework.stereotype.Component;

import com.feng.zhihao.apigeteway.gateway.ReqContext;
import com.feng.zhihao.apigeteway.gateway.bean.RES_PARAMS_POSITION;
import com.xiaoleilu.hutool.log.Log;
import com.xiaoleilu.hutool.log.LogFactory;

@Component("RES_PARAMS_POSITION_HTTP_BODY")
public class RES_PARAMS_POSITION_HTTP_BODY  implements RES_PARAMS_POSITION{

	Log log=LogFactory.get();
	
	@Override
	public void outPutRes(ReqContext reqContext) {
		try {
			reqContext.setResParamsString(reqContext.getResParams().toJSONString());
			reqContext.getResponse().getOutputStream().write(reqContext.getResParamsString().getBytes("UTF-8"));
			reqContext.getResponse().getOutputStream().flush();
		} catch (IOException e) {
			log.error(e);
		}
	}

}
